﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using System.Data.Entity.Migrations;
using csharp_webapi_415.Data.Models;

namespace csharp_webapi_415.Data
{
    public static class Seeder
    {
        public static void Seed(ApplicationDbContext db)
        {

            db.Actors.AddOrUpdate(
                actr => actr.ActorId,
                new Actor() {ActorId=1, Age=100, Name="Mike Tyson" },
                 new Actor() { ActorId = 2, Age = 20, Name = "John Wayne" },
                  new Actor() { ActorId = 3, Age = 30, Name = "Jonny Depp" }
                );

            db.Flicks.AddOrUpdate(
                flk => flk.FlickId,
                new Flick() {FlickId=1, Name="Hangover pt5" },
                 new Flick() {FlickId=2, Name="Pirates of the Carribean" }

                );
            db.FlickActor.AddOrUpdate(
                fa => fa.FlicksActorsId,
                new FlicksActors() {FlicksActorsId=1, ActorId=3, FlickId=2 },
                new FlicksActors() {FlicksActorsId=2, ActorId=1, FlickId=2 },
                new FlicksActors() {FlicksActorsId=3, ActorId=2, FlickId=2 },
                new FlicksActors() {FlicksActorsId=4, ActorId=2, FlickId=1 },
                new FlicksActors() {FlicksActorsId=5, ActorId=3, FlickId=1 }
                );



            //    context.People.AddOrUpdate(
            //      p => p.FullName,
            //      new Person { FullName = "Andrew Peters" },
            //      new Person { FullName = "Brice Lambson" },
            //      new Person { FullName = "Rowan Miller" }
            //    );
        }
    }
}
